This invention relates to computer systems and, more particularly, to servers for Internet web sites.
In the use of the Internet, users may contact an Internet web site to view or obtain information. The user""s contact with the web site is typically with a web server, or Hyper Text Transfer Protocol (HTTP) server. Behind and supporting the web server is an application server. A web site intended to handle lots of demand may use multiple web servers and/or multiple application servers.
To a point, adding an application server allows the system to be scaled to handle increased use. Theoretically, the system would scale linearly. For example, by doubling the hardware for the application servers, the system capacity would be doubled. However, known scalability models do not provide linear scaling.
At some point, adding hardware will not add capacity and may decrease capacity due to needed cross-communication between the application servers. Typically, each new application server increases the amount of cross-communication required to handle a request, thereby decreasing the overall efficiency of the system. Consequently, decreasing the amount of cross-communication is very important for achieving high degrees of scalability.
The Dynamo 3.0 application server, provided by the Art Technology Group, Boston, Massachusetts, the assignee of the present application, achieves a near-linear scalability through the use of session-based load-balancing techniques. When a new user enters the web site for the first time, she is assigned a particular Dynamo application server, which will host the duration of her session. The assignment of the application server is made through a weighted random selection according to load, so that lightly-loaded application servers are more likely to get new sessions.
A problem with session-based load balancing mechanisms is that the failure of an application server results in the loss of the information for the user session being hosted by the failed server. In order to recover from a failure and to xe2x80x9cfail overxe2x80x9d to a new server, the session data must be saved on another machine or otherwise outside the application server, so that it can be restored to another server.
In some existing application server designs, this problem is addressed by broadcasting the session data on each application server to each of the other application servers. However, this significantly increases the amount of cross-communication, thereby greatly decreasing the scalability of the system.
According to the present invention, session data is saved through the use of a third tier of servers, in addition to the web (or HTTP) server(s) and the application server(s). This third tier of servers, or backup servers, is responsible for backing up the session data. The system assigns to each session a session ID. The session ID encodes the IP addresses of the backup server and the application server, as well as a unique identifier for the session, so that when a session is switched to another application server the switch can be detected by the new application server and the session data can be retrieved from the backup server.
Each application server is assigned to a single backup server. Each backup server may serve data for one or more application servers. As session data is modified, the data is backed up to the backup server. If an application server should fail, the request is automatically routed to another application server as if it were a new session. However, the request uses the original session ID. The new application server detects that the request may be from a failed session because, for example, the server is not currently hosting a session with that session ID. The new application server extracts the backup server""s IP address, encoded in the session ID, and connects to the backup server. The application server requests the backed-up data corresponding to the session ID. If the data is available, then the new application server knows that the request came from a failed session, and reconstitutes the backed up data into a new session with a new session ID.
Alternatively, the invention can be used in the absence of the failure of an application server, to transfer a user session from one application server to a different application server and back, without losing session data.